package com.tarry.shop.minio;

import com.tarry.shop.validation.Add;
import com.tarry.shop.validation.Delete;
import com.tarry.shop.validation.Query;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel(description = "Minio文件存储对象")
public class MinioVO {

    @ApiModelProperty("桶名称")
    @NotBlank(message = "桶名称不能为空",groups = {Query.class , Delete.class, Add.class})
    @Length(min = 3, max = 63, message = "桶名称只能在3-63之间")
    private String bucketName;

    @ApiModelProperty("文件对象名称")
    @NotBlank(message = "文件对象名称不能为空",groups = { Delete.class, Add.class})
    private String objectName;

    @ApiModelProperty("文件名称")
    @NotBlank(message = "文件名称不能为空",groups = {Add.class})
    private String fileName;

    @ApiModelProperty("文件访问路径")
    private String url;
}
